package com.zyl.blog.dao;

import com.zyl.blog.pojo.Tag;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author 14323
 * @date 2020/8/8 19:44
 */
public interface TagRepository extends JpaRepository<Tag, Long> {

    Tag findByName(String name);

    @Query("select t from Tag t ")
    List<Tag> findTop(Pageable pageable);

}
